All Questions
181 questions
6votes
7answers
1kviews
Filter non-even elements from an array
I have a method that returns an int[]. The array is made by filtering out only the even values of the array passed into the method. It works, but it's really ugly ...
6votes
3answers
333views
Implementation of arrays that store their size
In this code I implemented arrays that store their own size before the first element. To access it you need to go back exactly sizeof(size_t) bytes back. To free it,...
6votes
4answers
1kviews
Automate character search in C
THE TASK We are dealing with a string of symbols and need quick responses to queries of the following types: What is the position of the k-th occurrence of symbol X in the string? Reading from ...
4votes
2answers
2kviews
Linked list and array list performance comparison in C
After watching Stroustrup's presentation on performance comparison between vectors and linked lists (https://youtu.be/YQs6IC-vgmo?si=9r5wXqnwkmN29xqn), I've decided it would be a good problem to get a ...
2votes
0answers
83views
Javascript basic search engine recipes
I have made a search engine for recipes. Requirements for this JS Project are as follow: Create a function called searchRecipes that takes all recipes and an ...
5votes
4answers
2kviews
Automate the boring stuff with python - Character picture grid
Character Picture Grid Say you have a list of lists where each value in the inner lists is a one-character string, like this: ...
0votes
1answer
107views
Printing Permutations
Following is a leetcode problem: Given an array nums of distinct integers, return all the possible permutations. You can return all the possible permutations. You can return the answer in any order. ...
2votes
1answer
77views
Helper functions to get, set and remove from Firefox browser storage. Also, to get, push and remove from lists stored in the database
I am making a plugin for Firefox, this is (more or less) my first time working with JavaScript. Is this a reasonable design for working with both values and lists in a database? ...
1vote
2answers
458views
Simple snake game with C and raylib
Made a simple snake game using C and raylib for graphics, Would like to be critiqued on the clearity and efficiency of the code. ...
4votes
1answer
947views
Writing a Java program that outputs a calorie/macronutrient plan for getting in shape over a certain amount of weeks
I am new to programming and was working on a project that calculates an entire "diet plan" as well as a projected weight goal for each week. There are three objects that all have methods ...
2votes
1answer
138views
How many times element of one array occurs in another array?( HackerRank sparse arrays problem)
with basic knowledge of multiset and vectors in c++ I solved the following problem. How can I improve my code and also handle any input errors? Problem statement: There is a collection of input ...
3votes
1answer
272views
Array rotation in C++
I am completely new to data structures and algorithms. I tried this problem on hackerank. I got the desired output but my code wasn't efficient enough to execute in the given time limit. How can I ...
2votes
1answer
114views
Another generic dynamic arrays in C
Wrote this (and others not here) as an exercise to explore how generics could be implemented in C. Question -- if I were to support out-of-band error setting, how would that look like for ...
0votes
2answers
2kviews
1vote
3answers
336views